'''
Created on 27.03.2014

@author: Wir
'''

class Objects(object):
    '''
    Defines player and enemies properties and methods.
    '''
    def __init__(self,posX,posY,leben,munition,speed):
        self.PosX = posX
        self.PosY = posY
        self.Leben = leben
        self.Munition = munition
        self.Speed = speed
    
    posX = 0
    posY = 0
    leben = 0
    munition = 0
    speed = 0
    direction = ""
    
    def move(self, x):
        self.posX += x    
        if x<0:
            direction = "leftwards"
            x *= -1
        elif x>0:
            direction = "rightwards"
        print "Moved the " + self.__class__.__name__ + " "+ str(x) + " Steps " + direction + "."
        print self.__class__.__name__ + " is now on Position " + str(self.posX) + " " + str(self.posY) + "."

class Enemy(Objects):
    def __init__(self,posX,posY,leben,munition,speed,no):
        Objects.__init__(self,posX,posY,leben,munition,speed)

    PosX = 4
    
def addEnemies(self,anzahl,leben,munition,speed):
    print "--------------------"
    print "Creating " + str(anzahl) + " Enemies"
    print "--------------------"
    print ""
    Enemies = [Enemy(10,10,100,10*i,i,i) for i in range(anzahl)]  
    for i in range(anzahl):
        Enemies[i].no = i
        Enemies[i].speed = speed
        Enemies[i].munition = munition
        Enemies[i].leben = leben
        if i == anzahl-1:
            print "All Enemies been created!"
            print ""
    
    print "--------------------"
    print "Listing the Enemies"
    print "--------------------"
    print ""    
    for i in range(anzahl):
        'showEnemy(self,i)'
        print "Informations about Enemy No. " + str(i)
        print "Number: " + str(Enemies[i].no)
        print "Health: " + str(Enemies[i].leben)
        print "Ammunantion: " + str(Enemies[i].munition)
        print "Speed: " + str(Enemies[i].speed)        
        print "Position: " + str(Enemies[i].posX) + "|" + str(Enemies[i].posY)
        print ""
        if i == anzahl-1:
            print "All Enemies been listed!"
            print ""    
            
'''def showEnemy(self,nummer):
    i = nummer
    print "Informations about Enemy No. " + str(i)
    print "Number: " + str(Enemies[i].no)
    print "Health: " + str(Enemies[i].leben)
    print "Ammunantion: " + str(Enemies[i].munition)
    print "Speed: " + str(Enemies[i].speed)        
    print "Position: " + str(Enemies[i].posX) + "|" + str(Enemies[i].posY)
    print ""'''

            
addEnemies(0, 20, 4, 3, 2)
Objects.Enemies[2].move(5)
            